package homework;

import java.util.Scanner;

public class Test9 {
    public static void main(String[] args) {
        System.out.println("输入你的身份证号");
        if (checkID(new Scanner(System.in).nextLine())){
            System.out.println("身份证格式正确");
        }
        else {
            System.out.println("格式错误");
        }
    }
    public static boolean checkID(String id){
        if (id.matches("[1-9]\\d{16}[\\d,X]")){
            return true;
        }else{
            return false;
        }
    }
}
